﻿@model mitasoft.Component.Models.PagedData<mitasoft.Component.Models.Blog.PostInfo>
@{
    Layout = null;
    var recentPostGrid = new WebGrid(rowsPerPage: 3);
    recentPostGrid.Bind(Model.Data, autoSortAndPage: false, rowCount:Model.Total);
}
<script type="text/javascript">
    $(function () {
        $('#blog-posts-list a').lightBox({ fixedNavigation: true });
    });
</script>

@recentPostGrid.GetHtml(
    mode: WebGridPagerModes.NextPrevious,
    nextText: "Older posts",
    previousText: "Newest posts",
    columns: new List<WebGridColumn> { 
        
        /* blog post template */
        recentPostGrid.Column(format: 
        @<div class="well" style="margin: 5px; overflow: auto;">
            <h3>@item.Title</h3>
            <div style="font-style: italic;">@item.DateCreated.ToString("dd MMMM yyyy @ HH:mm:ss")</div>
            <br />
            <div>
                @Html.Raw(item.Description)
            </div>
        </div>)
    })

@*@foreach (var post in Model)
{
    @Html.DisplayFor(x => post)
    <br />
}*@
